#pragma once 

#include "Control.h"
#include "Container.h"

namespace My {

class Widget : public virtual Control
{
private:
	CRect	m_Bounds;
	bool	m_Visible;
	bool	m_Enabled;
	CFont *	m_pFont;
public:
	virtual CRect Bounds() const 
		{ return m_Bounds; }
	virtual bool Visible() const
		{ return m_Visible; }
	virtual bool Enabled() const
		{ return m_Enabled; }
	virtual CSize GetPreferredSize() const
		{ return CSize(0, 0); }
	virtual const CFont * Font() const;
public:
	Widget();
public:
	void SetBounds(const CRect & r);
	void SetBounds(int left, int top, int right, int bottom)
		{ SetBounds(CRect(left, top, right, bottom)); }
	void SetVisible(bool on);
	void SetEnabled(bool on);
	void SetFont(CFont * pFont);
public:
	// handlers
	virtual void CheckBounds(CRect & r) { }
	virtual void HandleResize(int sx, int sy) { }
	virtual void HandleVisible(bool on) { }
	virtual void HandleEnable(bool on) { }
};

} // My
